package com.lock.type;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Author: tgy
 * @Date: 12/7/20 4:59 PM
 */
public class AtomicDemo01 {

    public static void main(String[] args) {

        AtomicInteger atomicInteger = new AtomicInteger(10);

        int except;

        do {

            except = atomicInteger.get();
            System.out.println(except);
        }while (!atomicInteger.compareAndSet(except,20));

    }


}
